<%@ page import="java.util.Map" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2021/11/3
  Time: 21:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    List<Map<String,Object>> questionsList= (List<Map<String,Object>>)request.getAttribute("questionList");
%>
<center>
    <form action="http://localhost:8080/onlineSystem/Score">
        <table>
<%
                for(Map<String,Object> questionMap:questionsList){
                    Integer id = (Integer)questionMap.get("id");
                    String question = (String) questionMap.get("question");
                    String optionA = (String)questionMap.get("optionA");
                    String optionB = (String)questionMap.get("optionB");
                    String optionC = (String)questionMap.get("optionC");
                    String optionD = (String)questionMap.get("optionD");
%>
            <tr>
                <td><%=question%></td>
                <td>
                    <input type="radio" name="<%=id%>" value="A" /><%=optionA%>
                    <input type="radio" name="<%=id%>" value="B" /><%=optionB%>
                    <input type="radio" name="<%=id%>" value="C" /><%=optionC%>
                    <input type="radio" name="<%=id%>" value="D" /><%=optionD%>
                </td>
            </tr>
<%
                }
%>
            <tr>
                <td colspan="2">
                    <input type="submit">
                </td>
            </tr>
        </table>
    </form>
</center>
